<template>
  <div>
    <el-input v-model="username" placeholder="用户名"></el-input>
    <el-input v-model="password" placeholder="密码"></el-input>
    <el-button @click="login">登录</el-button>
  </div>
</template>

<script>
  import Vue from 'vue';
  import Component from 'vue-class-component';

  @Component
  export default class Login extends Vue {
    username = 'hm_zw123';
    password = '123456';

    login() {
      this.$ajax({
        method: 'post',
        url: 'loginSubmit.do',
        data: this.$qs.stringify({
          loginName: this.username,
          password: this.password
        })
      }).then(resp => {
        console.log(resp);
      }, error => {
        console.log(error);
      });
    }
  }
</script>

<style scoped>
</style>
